package com.lhj.es.util;

/**
 * @author linghaijin
 */
public class BackUpUtil {

    private static String RSA = "RSA";

//    static String priKey =
//            "-----BEGIN RSA PRIVATE KEY-----\n" +
//                    "MIICXAIBAAKBgQCtX0eWgh9AD2hPuiNGMSH24ocwB3bpIYruuKk8jUeARb/qfjEx\n" +
//                    "WYNRtdGFs79Pm9L7Sfl29JjuBCpg70iTrF0pIgXd9pjLWdwmeF7IF9e3c5IgjA4I\n" +
//                    "Nml1qe4g/8baXynfhX90vUGdy3UfpFgzT//Danxa/W8jg8Bfj0irgqyIGQIDAQAB\n" +
//                    "AoGAEgqsRHleDyiLTmCscw2B31NLhjAAq9oVvynwUqDRJAQeKKThMaWDCOnG2AcQ\n" +
//                    "jZRFrGjSURK7J2m/jz7XaqaxOv651Nf7xckc8Wr+CVKWcQp0Ekv6kbF6+gbsje9R\n" +
//                    "bP0MUJLtrd4SmNZgOItz7IC+kYuhd/SChDoX447G4HV49AECQQDU59b5PjqYmY81\n" +
//                    "T/bJl6kP2rT55KVVPGOh38EMGy3VZua9HFx4QihxTYOTpmc9cxyfuwMcppyGnm19\n" +
//                    "mgQhdBC5AkEA0HbuJbhXNyxGL2i+XR+jc5ccSqjMR9noXpgG62/BA+6ahOL9ZxBQ\n" +
//                    "1HwIVUs/qQf8cXR71sfmKKu33L0/KjbCYQJAFrYQgY/40jR3SVmZWtHZz/4llg6k\n" +
//                    "8F27xxXGUxNHJV+Pt5ah6pYsGEILiiGTG8P+xq89Wr4PLnER/vcB/8uQyQJAV6or\n" +
//                    "6+DhjGop+bXql+6+JdXeJ+dkQLL6bQ0xm8CbQrQMduWd+sF5vGGMf5Hta3/YQT3i\n" +
//                    "9ieKOoA8Ca/r6CyvAQJBAImOZakR3BndNXJNqQT/a5OPaGTT5D5P1i4GyzixxV7n\n" +
//                    "yZgoxrg+Us6rm30byXCyqF8JC68O/CXaGLlHGPRgiLA=\n" +
//                    "-----END RSA PRIVATE KEY-----";


    public static String priKey_PKCS8 = "MIIEvQIBAD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RjwKBgEX/IuVSrlRyer6sY3rjkkxkiAg0oIy5Zvn3k6pkL4GkGE/anI1szsD6kHlKNgp9fxen0FsyzEjBz2V0xGzrLqgO3rX2nW29vGTX7RufNHFPtvY0QroKQnWN6iLdk//mu5bJnfv+c0NdBWLw6G0QZb8Mdm0eAOVcBOUl2bs4GH0BAoGATvpm52Dp4uLVVo6SSTyJepxGU62V/DaB0/SAn3OoET5irnH0TNV+sFRL/1cGW1psLeAMCsI6zJbLbnpuw1hUpr4e/IQ5o8F8rSk4e6zD0MB1+mrrKXIPwj5cW5KXGPHAxkv0FkSelhlXW5z6q6ola2rOL10N5gTlTRfu2SJNiekCgYEAmqADo1cyuLsxaPCxOD3Lbb2BZjRB/J0zaD3Z2ogeAsOwO/pR+XtMn338PFTE/LOWvs8r+lz+97xV+gQxqFgn+9BGq7d+w3F9ErhH9/W6lPTVfUAyqZkVHI4CCd50dNDr/zhxWmdyf3F12a7K602yQhYd9g8dEvH08Td4bgWse4o=";


    /**
     * 用私钥解密
     *
     * @param encryptedData 经过encryptedData()加密返回的byte数据
     * @return
     */
    public static String decryptData(String encryptedData) {
        try {
            return RSAUtil.decryptByPriKey(encryptedData, priKey_PKCS8);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }


}
